
//配置路由
import 'package:flutter/material.dart';
import 'package:flutter3/tabs/Tabs.dart';
import 'package:flutter3/tabs/route/search.dart';

final rout = {
  '/search':(context,{arguments})=>searchPage(arguments:arguments),
  '/':(context)=>Tabs()
};

final onGenerateRoute = (RouteSettings settings){
   final String name = settings.name;
      print("当前跳转路由------------------------------->");
        print(name);
        final Function pageContentBuilder = rout[name];
        if(pageContentBuilder != null){
          if(settings.arguments!=null){
            final Route router = MaterialPageRoute(builder: (context)=>
            pageContentBuilder(context,arguments:settings.arguments));
            return router;
          }else{
            final Route router = MaterialPageRoute(
              builder: (context)=>pageContentBuilder(context)
            );
            return router;
          }
        }
};